#!/usr/bin/python3
# -*- coding:utf-8 -*-

from urllib.request import urlopen
from bs4 import BeautifulSoup

# 第一页
url="https://movie.douban.com/top250?start=25"

url_response = urlopen(url)
bs = BeautifulSoup(url_response, "html.parser")

hds_list= bs.select("div.hd > a")
print(len(hds_list))
for hd in hds_list:
    titles_list = hd.select("span")
    titles =[]
    for title in titles_list:
        one_title = title.text
        one_title = one_title.strip("/")
        titles.append(one_title)
    print(",".join(titles))





